package vek.XML.parsedObjects;

import java.util.ArrayList;
import vek.Objects.POI;
import vek.Objects.Restaurant;

/**
 * Simple class to contain the ParsedRestaurant data read by the XML Parsers.
 * This class is then used to create the Restaurant object by giving this object to its constructor.
 * When a ParsedComercial object is created, the ParsedComercial class takes care of its own variable changes and.
 * @see ParsedAttractions
 * @author Christian, Michal og Jakob (Hold1, gruppe 2)
 */

public class ParsedRestaurant extends ParsedComercial implements ParsedObjectInterface{
    
    public ParsedComercial parsedComercial;
    
    public ArrayList<String> typesOfFoodSold;
    
    /**
     * 
     * @param pc the ParsedComecial object which contains all the data which is not solely the Restaurant data, essentially everything in the XML file except the type of foods sold
     * @param typesFood the types of food by this restaurant.
     */
    
    public ParsedRestaurant(ParsedComercial pc, ArrayList<String> typesFood)
    {
        super(pc);
        typesOfFoodSold = typesFood;
        parsedComercial = pc;
        
    }
    
    @Override
    public String toString()
    {
        String s = super.toString();
        s = s + "Foodtype: ";
        for(int i = 0; i < typesOfFoodSold.size(); i++)
        {
            s += typesOfFoodSold.get(i); 
        }
        return s;
    }
    
    public POI getAsPOI()
    {
        return new Restaurant(this);
    }
    
    

}
